package com.service.Impl;

import com.dao.UserHistoryDao;
import com.mypg.UserHistory;
import com.service.UserHistoryService;

public class UserHistoryServiceImpl implements UserHistoryService {

    private UserHistoryDao userHistoryDao;

    public UserHistoryServiceImpl(){}
    public UserHistoryServiceImpl(UserHistoryDao userHistoryDao) {
        this.userHistoryDao = userHistoryDao;
    }

    @Override
    public int selectIndexByUser_idAndHistory_class(int user_id, String history_class) {
        return userHistoryDao.selectIndexByUser_idAndHistory_class(user_id,history_class);
    }

    @Override
    public void updateIndexByUser_idAndHistory_class(int history_index, int user_id, String history_class) {
        userHistoryDao.updateIndexByUser_idAndHistory_class(history_index,user_id,history_class);
    }

    @Override
    public void insertUserHistory(UserHistory userHistory) {
        userHistoryDao.insertUserHistory(userHistory);
    }

    public UserHistoryDao getUserHistoryDao() {
        return userHistoryDao;
    }

    public void setUserHistoryDao(UserHistoryDao userHistoryDao) {
        this.userHistoryDao = userHistoryDao;
    }
}
